<template>
	<view>
		  <view class="AfterSale-demo" v-for="item in afterSaleVoList">
			<view>
			  <view span="4"><view name="shop-o" size="24"/></view>
			  <view span="9" style="text-align: left;margin-top: 0.2rem">{{item.shopsName}}</view>
			  <view span="9" style="text-align: right;">
				{{item.orderStatus==1?'待付款':(item.orderStatus==2?'待发货':(item.orderStatus==3?'待收货':(item.orderStatus==4?'已收货':(item.orderStatus==5?'交易取消':
				(item.orderStatus==6?'删除订单':(item.orderStatus==7?'取消订单':'退货'))))))}}
			  </view>
			</view>
			<view>
			  <view span="7"><image :src="item.picUrl" mode="" style="width: 250rpx;height: 250rpx;float: left;"></image></view>
			  <view span="16" style="text-align: left" >
				<p style="padding-bottom: 0.5rem;text-indent:0.5rem">{{item.productName}}</p>
				<view>
				  <view span="12" style="text-align: left;font-size: 0.6rem;text-indent:0.5rem">{{item.labelName}},{{item.labelUnit}}</view>
				  <view span="10" style="text-align: right;margin-right: 2rem;margin-top: 150rpx;">￥{{item.labelPrice}} × {{item.productCnt}}</view>
				</view>
			  </view>
			</view>
			<P style="font-size: 1.1rem;text-align: right;padding: 0.8rem 2rem 0 0">共计{{item.productCnt}}件商品 合计：￥{{item.labelPrice*item.productCnt}}</P>
			<view align="right" style="padding: 0.5rem 1.8rem 0 0">
			 <van-button color="#fb5d63" plain round style="height: 2rem;width: 7rem" @click="tpApplySale(item)">申请售后</van-button> 
			<van-button color="#ec8b1b" plain round style="height: 2rem;width: 7rem" v-if="item.orderStatus==4 && item.commentStatus==0" @click="evaluateOrderVo(item)">商品评价</van-button>
			</view>
		  </view>
	</view>
</template>

<script>
	  import { selectAfterSaleVo } from '../../api/commodity/order_master.js';
	  import { Toast } from 'vant';
	export default {
		data() {
			return {
				afterSaleVoList:[],
			    //订单售后查询参数
				afterSaleVo:{
				  customerId:'',
				},
				
			}
		},
		created() {
		  this.getSelectAfterSaleVo();
		},
		methods: {
			//去售后选择页面
			tpApplySale(list){
				sessionStorage.setItem('list',JSON.stringify(list));
				uni.navigateTo({
					url: '../ApplySale/ApplySale'
				});
			},
			//去评价页面
			evaluateOrderVo(list){
				sessionStorage.setItem('list',JSON.stringify(list));
				uni.navigateTo({
					url: '../EvaluateOrder/EvaluateOrder'
				});
			},
			 //订单售后查询
			  getSelectAfterSaleVo(){
				selectAfterSaleVo(this.afterSaleVo).then((res)=>{
					if(res.data.code==200){
					  this.afterSaleVoList = res.data.data;
					}
					console.log(res)
				  })
			  },
			  
			
		}
	}
</script>

<style>
	.demo-nav{
	    position: relative;
	    display: flex;
	    -webkit-box-align: center;
	    align-items: center;
	    -webkit-box-pack: center;
	    justify-content: center;
	    height: 56px;
	    background-color: #fff;
	    font-size: 1.1rem;
	  }
	  .demo-nav__back{
	    position: absolute;
	    top: 16px;
	    left: 16px;
	    width: 24px;
	    height: 24px;
	    cursor: pointer;
	  }
	  .AfterSale-demo{
	    padding: 0.5rem;
	    border: 1px solid #ebedf0;
	    border-radius: 1rem;
	    margin: 0.5rem 0;
	  }
</style>
